Improve MOTW error handling in download flow#6127
Merged
JohnMcPMS merged 5 commits intomicrosoft:masterfrom Apr 13, 2026
Merged
Improve MOTW error handling in download flow#6127JohnMcPMS merged 5 commits intomicrosoft:masterfrom
JohnMcPMS merged 5 commits intomicrosoft:masterfrom
Conversation
JohnMcPMS
reviewed
Apr 6, 2026
This comment has been minimized.
This comment has been minimized.
|
Sorry to ask here. 🙏🏼 Is there any unknown reason that blocks this PR? A new preview version of |
This was referenced Apr 8, 2026
This was referenced Apr 9, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
JohnMcPMS
reviewed
Apr 13, 2026
| @@ -536,21 +549,31 @@ namespace AppInstaller::Utility | |||
|
|
|||
| std::thread aesThread([&]() | |||
Member
There was a problem hiding this comment.
I just realized that the failures being missing from the logs is probably due to this new thread. If you want this change to actually make the logs show up and not just fix the error handling, you would need to:
// outside lambda
ThreadGlobals* globals = ThreadGlobals::GetForCurrentThread();
// capture into lambda
... = [..., globals] (...)
{
if (globals)
{
auto globalsCleanup = globals->SetForCurrentThread();
}
...
}
Contributor
Author
There was a problem hiding this comment.
Given that the error handling is the main thing causing the issue, my preference is to get this error handling merged so that some portion of the local manifests start working again for users who are having issues, and I can raise a second PR for the logging globals
JohnMcPMS
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix MOTW security check failures for downloaded installers
Problem
All installer downloads were failing the security check with 0x80070003 (ERROR_PATH_NOT_FOUND), causing every install to terminate with "Installer failed security check".
Two root causes were identified:
temporary pre-hash-validation file (a raw SHA256 hex string with no extension, e.g. aab2dc8e…) rather than the final installer (e.g. BadlionClient.exe).
Important
Shell32's AES relies on file extension for MIME-type detection, scan policy, and zone assignment, so scanning an extensionless file produced unreliable results
called and the whole check returning a failure code. Additionally, a missing THROW_IF_FAILED(hr) after IPersistFile::Load meant unexpected load errors were silently ignored, leading to Remove()/Save()
being called on a non-loaded object.
Changes
DownloadFlow.cpp
Downloader.cpp — RemoveMotwIfApplicable
Downloader.cpp — ApplyMotwUsingIAttachmentExecuteIfApplicable
security scan.
CoInitializeEx so failures are captured through WIL.
never updated
Microsoft Reviewers: Open in CodeFlow